using System;
using System.Collections;


namespace DiscGolfScore
{
	/// <summary>
	/// Summary description for Course.
	/// </summary>
	public class Course
	{
		public ArrayList holes = new ArrayList();
		public int Id;
		private string name;
		public string Name 
		{
			get 
			{
				return name;
			}
			set 
			{
				name = value;   
			}         
		}

		public int GetPar() 
		{
			int par = 0;
			foreach( Hole h in holes ) 
			{
				par+=h.par;
			}
			return par;
		}

		public Course()
		{
		}
	}

	public class Hole
	{

		public int par;
		public int length;
		public string description;
		public Hole()
		{
		}

		public Hole Copy() 
		{
			Hole newHole = new Hole();
			newHole.par = par;
			return newHole;
		}

		public string ToXml() 
		{
			string xml = "<hole par=\""+par+"\" />\n";
			return xml;
		}
	}
}
